#pragma once

#include "Output/Console.h"

#include "Containers/Containers.h"
#include "ScriptCompiler/Token/FilePosition.h"

class CScriptToken;
class CScriptFileContext;

enum class EASTNodeType
{
    Unknow,
    Namespace,
    Using,
    Class,
    Enum,
    Delegate,
    Parameter,
    AccessLevel,
    Function,
    OperatorFunction,
    FunctionContent,
    Field,
    EnumValue,
    Property,
    PropertyIndexer,
    GetAccessor,
    SetAccessor,
    Constructor,

    PositiveValue, // +1
    NegativeValue,  // -1
    MonocularOperator,
    BinocularOperator,
    QuestionColonOperator,
    Literal,
    VariableDeclaration,
    FunctionParameter,
    
    ExpressionSentence, //sentence just have one expression
    If,
    While,
    DoWhile,
    For,
    Foreach,
    Switch,
    Case,
    Default,
    Break,
    Continue,
    Return,
    New,

    Decorator,
    Type,
    SentenceBlock,
    Sentence,
    Parentheses,
    TypeCast,
    Identifier,
    SentenceIndexer,   // like [0] in a[0]
    Bracket,
    FunctionCall,
    Empty,
    Value,
    MemberAccess,
    Assign,
};

class CASTNode
{
public:
    CASTNode(std::weak_ptr<CScriptFileContext> InFile,EASTNodeType InType);

    virtual ~CASTNode() {};
    
    std::shared_ptr<CScriptFileContext> GetFile() const { return File.lock(); }
public:

    EASTNodeType Type=EASTNodeType::Unknow;

    virtual void DebugPrint(int32_t InDepth)=0;

    //the file where this node is defined
    std::weak_ptr<CScriptFileContext> File;

    virtual std::shared_ptr<CScriptToken> GetFirstToken() = 0; 

};


